﻿<controls:ChildWindow xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"  x:Class="SLWebApp.ChildWindows.ChildWindow_ShipSchedule"
                       xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" 
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
           Width="720" Height="260"  Closing="ChildWindow_Closing"
           Title="新增/修改船期" FontFamily="Comic Sans MS" FontSize="12">
    <toolkit:BusyIndicator x:Name="progressbar" IsBusy="False" >
        <Grid x:Name="LayoutRoot" Margin="2">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <StackPanel>
                <Border BorderThickness="1" Height="30" BorderBrush="#b4b4b4" CornerRadius="1" >
                    <Border.Background>
                        <ImageBrush ImageSource="/SLWebApp;component/img/operate_box_bg.png" />
                    </Border.Background>
                    <StackPanel  Orientation="Horizontal" HorizontalAlignment="Left" >
                        <TextBlock Text="操作：" Padding="10,6" Height="30" Width="50"/>
                        <Image Width="16" Height="16" Source="/SLWebApp;component/img/icon_save.png"></Image>
                        <TextBlock x:Name="btnSave" MouseLeftButtonDown="btnSave_MouseLeftButtonDown" Padding="3,6" Cursor="Hand">保存</TextBlock>
                    </StackPanel>
                </Border>
                <Border BorderThickness="0" Height="5" >
                </Border>
                <!-- 靠泊表格内容-->
                <Border BorderThickness="1" BorderBrush="#b4b4b4" CornerRadius="1" >
                    <Grid>
                        <Grid.RowDefinitions >
                            <RowDefinition Height="30" />
                            <RowDefinition x:Name="gridSecondRow" Height="30" />
                            <RowDefinition x:Name="gridThirdRow" Height="30" />
                            <RowDefinition Height="30" />
                            <RowDefinition Height="30" />
                            <RowDefinition Height="30" />
                        </Grid.RowDefinitions >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition  Width="75" />
                            <ColumnDefinition Width="175"/>
                            <ColumnDefinition  Width="70" />
                            <ColumnDefinition Width="175"/>
                            <ColumnDefinition Width="70" />
                            <ColumnDefinition Width="125"/>
                            <ColumnDefinition Width="11*" />
                        </Grid.ColumnDefinitions>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="0" Grid.Column="0" Foreground="Red" HorizontalAlignment="Right" >*船舶类型：</TextBlock>
                        <ComboBox x:Name="comboxShipType" SelectionChanged="comboxShipType_SelectionChanged" Grid.Row="0" Grid.Column="1" Height="22">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Path=RV_MEANING}" />
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Right" >英文船名：</TextBlock>
                        <sdk:AutoCompleteBox Grid.Column="3" x:Name="autoComENName_Add" Padding="25,0,0,0" Height="22" SelectionChanged="autoComENName_Add_SelectionChanged" LostFocus="autoComENName_Add_LostFocus" IsDropDownOpen="True" IsTextCompletionEnabled="True" TabNavigation="Cycle" />
                        <ComboBox x:Name="comboxVesselName" HorizontalAlignment="Left"  Grid.Row="0" Grid.Column="3" Width="25" Height="22">
                            <sdk:DataGrid x:Name="dataGridVesselName" SelectionMode="Single" SelectionChanged="dataGridVesselName_SelectionChanged"
                          Height="Auto" Width="Auto"  MaxWidth="500" MaxHeight="200" IsReadOnly="True" AutoGenerateColumns="False" HorizontalContentAlignment="Center" >
                                <sdk:DataGrid.Columns>
                                    <sdk:DataGridTextColumn Header="英文船名" Binding="{Binding VSL_ENNAME}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                    <sdk:DataGridTextColumn Header="中文船名" Binding="{Binding VSL_CNNAME}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                    <sdk:DataGridTextColumn Header="IMO码" Binding="{Binding VSL_UNCODE}" ToolTipService.ToolTip="{Binding ChildRouteName}" Width="20*"  />
                                </sdk:DataGrid.Columns>
                            </sdk:DataGrid>
                        </ComboBox>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="0" Grid.Column="4"  HorizontalAlignment="Right">中文船名：</TextBlock>
                        <TextBlock x:Name="txtVesselCNName" Padding="3,3" Height="22" Grid.Row="0" Grid.Column="5" ></TextBlock>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="1" Grid.Column="0"  HorizontalAlignment="Right">航线：</TextBlock>
                        <TextBox x:Name="txtSeaRoutes" Grid.Row="1" Grid.Column="3"  Height="22" Padding="25,0,0,0" ></TextBox>
                        <ComboBox x:Name="comboxSeaRoutes" Grid.Row="1" Grid.Column="1" Height="22" SelectionChanged="comboxSeaRoutes_SelectionChanged">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <!--<TextBlock Text="{Binding Path=ID}" Width="40" />-->
                                        <!--航线代码-->
                                        <TextBlock Text="{Binding Path=RouteName}" Width="Auto" />
                                        <!--航线名称-->
                                    </StackPanel>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="1" Grid.Column="2"  HorizontalAlignment="Right">服务航线：</TextBlock>

                        <ComboBox x:Name="comboxServiceLine" HorizontalAlignment="Left"  Grid.Row="1" Grid.Column="3" Width="25" Height="22">
                            <sdk:DataGrid x:Name="dataGridSchedule" SelectionMode="Single" SelectionChanged="dataGridSchedule_SelectionChanged"
                          Height="Auto" Width="Auto"  MaxWidth="500" MaxHeight="200" IsReadOnly="True" AutoGenerateColumns="False" HorizontalContentAlignment="Center" >
                                <sdk:DataGrid.Columns>
                                    <sdk:DataGridTextColumn Header="服务航线" Binding="{Binding RouteName}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                    <sdk:DataGridTextColumn Header="营运人航线" Binding="{Binding ChildRouteName}" ToolTipService.ToolTip="{Binding ChildRouteName}" Width="47*"  />
                                    <sdk:DataGridTextColumn Header="船公司" Binding="{Binding CST_CSTM}"  ToolTipService.ToolTip="{Binding CST_CSTM}"  Width="13*"  />
                                </sdk:DataGrid.Columns>
                            </sdk:DataGrid>
                        </ComboBox>


                        <TextBlock Padding="3,3" Height="22" Grid.Row="1" Grid.Column="4"  HorizontalAlignment="Right">船公司：</TextBlock>
                        <TextBlock x:Name="txtVesselName" Padding="3,3" Height="22" Grid.Row="1" Grid.Column="5" ></TextBlock>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="2" Grid.Column="0"  HorizontalAlignment="Right">班期：</TextBlock>
                        <ComboBox x:Name="comboxVesselDate" Grid.Row="2" SelectionChanged="comboxVesselDate_SelectionChanged" Grid.Column="1" Height="22">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Path=RouteName}" Width="Auto" />
                                    </StackPanel>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="2" Grid.Column="2"  HorizontalAlignment="Right">预靠码头：</TextBlock>
                        <TextBlock x:Name="txtTerminal" Padding="3,3" Height="22" Grid.Row="2" Grid.Column="3" ></TextBlock>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="2" Grid.Column="4"  HorizontalAlignment="Right">船代理：</TextBlock>
                        <TextBlock x:Name="txtAgentName" Padding="3,3" Height="22" Grid.Row="2" Grid.Column="5" ></TextBlock>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="3" Grid.Column="0"  HorizontalAlignment="Right">进口航次：</TextBlock>
                        <TextBox x:Name="txtImportVoyage" LostFocus="txtImportVoyage_LostFocus" Height="22" Grid.Row="3" Grid.Column="1"/>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="3" Grid.Column="2"  HorizontalAlignment="Right">出口航次：</TextBlock>
                        <TextBox x:Name="txtExportVoyage" Height="22" LostFocus="txtExportVoyage_LostFocus" Grid.Row="3" Grid.Column="3"/>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="3" Grid.Column="4"  HorizontalAlignment="Right">预报位置：</TextBlock>
                        <ComboBox x:Name="comboxPort" Grid.Row="3" Grid.Column="5" Height="22">
                            <ComboBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Horizontal">
                                        <!--航线名称-->
                                        <TextBlock Text="{Binding Path=RV_MEANING}" Width="Auto" />
                                    </StackPanel>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="4" Grid.Column="0" Foreground="Red"  HorizontalAlignment="Right">*抵港时间：</TextBlock>

                        <StackPanel Grid.Row="4" Grid.Column="1" Margin="0,3" Orientation="Horizontal" HorizontalAlignment="Left">
                            <sdk:DatePicker x:Name="datePicker_eta" Width="100" Height="22" HorizontalAlignment="Left"/>
                            <StackPanel x:Name="stackPanel_eta" Visibility="Collapsed" Orientation="Horizontal" HorizontalAlignment="Left">
                                <TextBox x:Name="txt_eta_h" Width="25" Text="00"  />
                                <TextBlock Text="时" Padding="0,3" />
                                <TextBox x:Name="txt_eta_M" Width="25" Text="00" />
                                <TextBlock Text="分" Padding="0,3" />
                            </StackPanel>

                        </StackPanel>


                        <TextBlock Padding="3,3" Height="22" Grid.Row="4" Grid.Column="2"  HorizontalAlignment="Right">离港时间：</TextBlock>
                        <StackPanel Grid.Row="4" Grid.Column="3" Margin="0,3" Orientation="Horizontal" HorizontalAlignment="Left">
                            <sdk:DatePicker x:Name="datePicker_etd" Height="22" Width="100" HorizontalAlignment="Left"/>
                            <StackPanel x:Name="stackPanel_etd" Visibility="Collapsed" Orientation="Horizontal" HorizontalAlignment="Left">
                                <TextBox x:Name="txt_etd_h" Width="25" Text="00" />
                                <TextBlock Text="时" Padding="0,3" />
                                <TextBox x:Name="txt_etd_m" Width="25" Text="00" />
                                <TextBlock Text="分" Padding="0,3" />
                            </StackPanel>
                        </StackPanel>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="4" Grid.Column="4"  HorizontalAlignment="Right">引航标志：</TextBlock>
                        <RadioButton Content="是" Name="rbtnYes"  Grid.Row="4" GroupName="voyage"  Grid.Column="5" Height="16" HorizontalAlignment="Left" IsChecked="True"  Margin="10,0,0,0"   />
                        <RadioButton Content="否" Name="rbtnNo"  Grid.Row="4"  GroupName="voyage" Grid.Column="5" Height="16" HorizontalAlignment="Left"  Margin="60,0,0,0"   />

                        <TextBlock Padding="3,3" Height="22" Grid.Row="5" Grid.Column="0"  HorizontalAlignment="Right">上一港：</TextBlock>
                        <sdk:AutoCompleteBox Grid.Row="5" Grid.Column="1" Height="22" x:Name="autoboxPort1" Padding="25,0,0,0"  IsDropDownOpen="True" IsTextCompletionEnabled="True" TabNavigation="Cycle" />
                        <ComboBox x:Name="comboxPort1" HorizontalAlignment="Left"  Grid.Row="5" Grid.Column="1" Width="25" Height="22">
                            <sdk:DataGrid x:Name="dataGridPort1" SelectionMode="Single" SelectionChanged="dataGridPort1_SelectionChanged"
                          Height="Auto" Width="Auto"  MaxWidth="500" MaxHeight="200" IsReadOnly="True" AutoGenerateColumns="False" HorizontalContentAlignment="Center" >
                                <sdk:DataGrid.Columns>
                                    <sdk:DataGridTextColumn Header="港口英文名" Binding="{Binding POT_PORTCD}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                    <sdk:DataGridTextColumn Header="港口中文名" Binding="{Binding POT_PORTLOCNNM}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                </sdk:DataGrid.Columns>
                            </sdk:DataGrid>
                        </ComboBox>

                        <TextBlock Padding="3,3" Height="22" Grid.Row="5" Grid.Column="2"  HorizontalAlignment="Right">下一港：</TextBlock>
                        <sdk:AutoCompleteBox Grid.Row="5" Grid.Column="3" Height="22" Padding="25,0,0,0" x:Name="autoboxPort2"  IsDropDownOpen="True" IsTextCompletionEnabled="True" TabNavigation="Cycle" />
                        <ComboBox x:Name="comboxPort2" HorizontalAlignment="Left"  Grid.Row="5" Grid.Column="3" Width="25" Height="22">
                            <sdk:DataGrid x:Name="dataGridPort2" SelectionMode="Single" SelectionChanged="dataGridPort2_SelectionChanged"
                          Height="Auto" Width="Auto"  MaxWidth="500" MaxHeight="200" IsReadOnly="True" AutoGenerateColumns="False" HorizontalContentAlignment="Center" >
                                <sdk:DataGrid.Columns>
                                    <sdk:DataGridTextColumn Header="港口英文名" Binding="{Binding POT_PORTCD}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                    <sdk:DataGridTextColumn Header="港口中文名" Binding="{Binding POT_PORTLOCNNM}"  ToolTipService.ToolTip="{Binding RouteName}" Width="40*"  />
                                </sdk:DataGrid.Columns>
                            </sdk:DataGrid>
                        </ComboBox>




                        <TextBlock Padding="3,3" Height="22" Grid.Row="5" Grid.Column="4"  HorizontalAlignment="Right">状态：</TextBlock>
                        <RadioButton Content="预报" Name="rbtnState1" Checked="rbtnState1_Checked"  Grid.Row="5" GroupName="state"  Grid.Column="5" Height="16" HorizontalAlignment="Left" IsChecked="True"  Margin="10,0,0,0"   />
                        <RadioButton Content="确报" Name="rbtnState2" Checked="rbtnState2_Checked"  Grid.Row="5" GroupName="state" Grid.Column="5" Height="16" HorizontalAlignment="Left"  Margin="60,0,0,0"   />


                    </Grid>
                </Border>
            </StackPanel>

        </Grid>
    </toolkit:BusyIndicator>
</controls:ChildWindow>